import { NgModule }  from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { BasketballComponent } from './basketball.component';
import {BootstrapComponent} from "./bootstrap/bootstrap.component";
import {LeagueComponent} from "./league/league.component";
import {MatchComponent} from "./match/match.component";


// 定义常量,嵌套自路由
const appChildRoutes: Routes = [
  {path: "one", component: BootstrapComponent},
  {path: "two", component: LeagueComponent},
  {path: "three", component: MatchComponent},
  // 如果地址栏中输入没有定义的路由就跳转到one路由界面
  {
    path: '**', redirectTo: "one"
  }
];

const routes: Routes = [
  {
    path: '', component: BasketballComponent,
    children: appChildRoutes
  },
];

@NgModule({
  imports: [
    RouterModule.forChild(routes),
  ],
  exports: [RouterModule],
  providers:[]
})

export class BasketballRouting {}
